package com.h4313.ghome.utils;

import android.app.Fragment;
import android.widget.Toast;

public class UIUtils {

	private static final String FORMAT_TIME = "%02d : %02d";
	
	public static void showToast(Fragment frag, CharSequence text, int duration) {
		if (frag.getActivity() != null)
			Toast.makeText(frag.getActivity(), text, duration).show();
	}
	
	public static void showToast(Fragment frag, int resid, int duration) {
		if (frag.getActivity() != null)
		Toast.makeText(frag.getActivity(), resid, duration).show();
	}

	public static String formatHour(int hour, int min) {
		return String.format(FORMAT_TIME, hour, min);
	}
	
}
